{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8000/ask', json={\"query\":\"这个项目干嘛的\"})\n",
    "request_id = v.json()[\"request_id\"]\n",
    "# print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8081/index/build',json={})\n",
    "request_id = v.json()[\"request_id\"]\n",
    "# print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8081/coding',json={\"query\":\"修改wow:true\"})\n",
    "request_id = v.json()[\"request_id\"]\n",
    "print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "v = requests.post(f'http://127.0.0.1:8081/extra/logs',json={ \"request_id\": request_id})\n",
    "print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "v = requests.get(f'http://127.0.0.1:8000/extra/result/{request_id}')\n",
    "print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8000/test/event/send', json={\"request_id\":\"1\"})\n",
    "print(v.content)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'request_id': 'd34be4b4-089f-4dfb-b99b-a776630ad701'}\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8081/coding',json={\"query\":\"修改wow:true\"})\n",
    "request_id = v.json()[\"request_id\"]\n",
    "print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8081/extra/event/get', json={\"request_id\":request_id})\n",
    "print(v.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "\n",
    "v = requests.post('http://127.0.0.1:8000/test/event/response', json={\"request_id\":\"1\"})\n",
    "print(v.json())"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "byzerllm",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
